// ignore_for_file: depend_on_referenced_packages

import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:retrofit/http.dart';
import 'package:dio/dio.dart';

import 'Initial.dart';

part 'MobileAppVersionApi.g.dart';
part 'MobileAppVersionApi.freezed.dart';

@RestApi()
abstract class MobileAppVersionApi {

  factory MobileAppVersionApi(Dio dio, {String baseUrl}) = _MobileAppVersionApi;

  @GET("mobileAppVersions/latest")
  Future<VersionResponse?> getLatestVersion(@Query("clientVersion") String clientVersion);

}

@freezed
class VersionResponse with _$VersionResponse{

  const factory VersionResponse({
    required String version,
    required List<String> updateNotes,
  }) = _VersionResponse;

  const VersionResponse._();

  factory VersionResponse.fromJson(Map<String, dynamic> json) => _$VersionResponseFromJson(json);

}


MobileAppVersionApi mobileAppVersionApi = MobileAppVersionApi(
    dio, baseUrl: baseUrl);